import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/liugou',
    name: 'liugou',
    component: () => import('../views/order/LiuGou.vue'),
  },
  {
    path: '/weimao',
    name: 'weimao',
    component: () => import('../views/order/WeiMao.vue'),
  },
  {
    path: '/',
    props:true,
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home/home.vue'),
    meta: {
      title: '宠物派-首页'
    }
  },
  // 日记页面
  {
    path: '/diary',
    name: 'diary',
    props:true,
    component: () => import('../views/home/diary.vue'),
    meta: {
      title: '宠物派-伴宠日记'
    }
  },
  // 日记详情
  {
    path: '/details',
    name: 'details',
    component: () => import('../views/home/details.vue'),
    meta: {
      title: '宠物派-伴宠日记'
    }
  },
  // 寄养页面
  {
    path: '/foster',
    name: 'foster',
    component: () => import('../views/foster/foster.vue'),
    meta: {
      title: '宠物派-寄养'
    }
  },
  // 寄养页面
  {
    path: '/fosterorder',
    name: 'fosterorder',
    component: () => import('../views/foster/foster_order.vue'),
    meta: {
      title: '宠物派-寄养订单'
    }
  },
  {
    path: '/petshopping',
    name: 'petshopping',
    component: () => import('../views/foster/PetShopping.vue'),
    meta: {
      title: '宠物派-宠物寄养'
    }
  },
  {
    path: '/order',
    name: 'order',
    component: () => import('../views/order/MyOrder.vue'),
    meta: {
      title: '宠物派-订单'
    }
  },
  {
    path: '/mine',
    name: 'mine',
    component: () => import('../views/mine/mine.vue'),
    meta: {
      title: '宠物派-我的'
    }
  },
  {
    path: '/cat',
    name: 'cat',
    component: () => import('../views/visit/Cat.vue'),
    meta: {
      title: '宠物派-上门遛猫'
    } 
  },
  {
    path: '/dog',
    name: 'dog',
    component: () => import('../views/visit/Dog.vue'),
    meta: {
      title: '宠物派-上门遛狗'
    } 
  },
  {
    path: '/catshopping',
    name: 'catshopping',
    component: () => import('../views/visit/CatShopping.vue'),
    meta: {
      title: '宠物派-上门喂猫订单',
      keepAlive:true  //保活
    } 
  },
  {
    path: '/dogshopping',
    name: 'dogshopping',
    component: () => import('../views/visit/DogShopping.vue'),
    meta: {
      title: '宠物派-上门遛狗订单',
      keepAlive:true  //保活
    } 
  },
  {
    path: '/address',
    name: 'address',
    component: () => import('../views/visit/Address.vue'),
    meta: {
      title: '宠物派-添加地址'
    } 
  },
  {
    path: '/address1',
    name: 'address1',
    component: () => import('../views/visit/Address1.vue'),
    meta: {
      title: '宠物派-添加地址'
    } 
  },
  {
    path: '/bz',
    name: 'bz',
    component: () => import('../views/visit/Bz.vue'),
    meta: {
      title: '宠物派-服务备注',
      keepAlive:true  //保活
    } 
  },
  {
    path: '/cdcard',
    name: 'cdcard',
    component: () => import('../views/visit/CDcard.vue'),
    meta: {
      title: '宠物派-宠物档案',
      keepAlive:true  //保活
    } 
  },
  {
    path: '/test',
    name: 'test',
    component: () => import('../views/visit/test.vue'),
    meta: {
      title: '宠物派-添加地址'
    } 
  },
  {
    path: '/fostercare',
    name: 'fostercare',
    component: () => import('../views/mypet/FosterCare.vue'),
    meta: {
      title: '申请寄养',
      keepAlive:true
    }
  },
  {
    path: '/personal',
    name: 'personal',
    component: () => import('../views/mypet/Personal.vue'),
    meta: {
      title: '申请领养',
       keepAlive: true
    }
  },
  {
    path: '/petpetpets',
    name: 'petpetpets',
    component: () => import('../views/mypet/Petpetpets.vue'),
    meta: {
      title: '申请伴宠专员'
    }
  },
  // {
  //   path: '/personal',
  //   name: 'personal',
  //   component: () => import('../views/mypet/Personal.vue'),
  //   meta: {
  //     title: '个人信息'
  //   }
  // },
  {
    path: '/uploaddairy',
    name: 'uploaddairy',
    props:true,
    component: () => import('../views/home/UploadDairy.vue'),
    meta: {
      title: '发布日记'
    }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue'),
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue'),
  },
  {
    path: '/vip',
    name: 'vip',
    component: () => import('../views/mine/minevip.vue'),
    meta: {
      title: 'vip'
    }
  },
  
  // 领养页面
  {
    path: '/adopt',
    name: 'adopt',
    component: () => import('../views/adopt/adopt.vue'),
    meta: {
      title: '宠物派-订单'
    }
  },
  {
    path: '/area',
    name: 'area',
    component: () => import('../views/adopt/area.vue'),
    meta: {
      title: '宠物派-选择区域',
      keepAlive:true
    }
  },
  {
    path: '/message',
    name: 'message',
    component: () => import('../views/adopt/Message.vue'),
    meta: {
      title: '宠物派-消息'
    }
  },
  {
    path: '/CatItem',
    name: 'CatItem',
    component: () => import('../views/adopt/CatItem.vue'),
    meta: {
      title: '宠物派-领养详情'
    }
  },
  {
    path: '/send',
    name: 'send',
    component: () => import('../views/adopt/Send.vue'),
    meta: {
      title: '宠物派-发布'
    }
  },
  {
    path: '/sendAdopt',
    name: 'SendAdopt',
    component: () => import('../views/adopt/SendAdopt.vue'),
    meta: {
      title: '宠物派-发布领养'
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router